package com.skit.mine;

import android.text.TextUtils;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class RegisterViewHelper extends ViewModel {
    //邮箱
    public MutableLiveData<String> emailAddress = new MutableLiveData<>();
    //验证码
    public MutableLiveData<String> verificationCode = new MutableLiveData<>();
    //密码
    public MutableLiveData<String> password = new MutableLiveData<>();

    //真实姓名
    public MutableLiveData<String> realName = new MutableLiveData<>();
    //学号
    public MutableLiveData<String> studentNumber = new MutableLiveData<>();


    public boolean canRegister(String email, String pwd, String code) {
        return !(TextUtils.isEmpty(email) || TextUtils.isEmpty(pwd) || TextUtils.isEmpty(code));
    }

    public boolean canSendVerificationCode(String email) {
        return !(TextUtils.isEmpty(email));
    }

    public boolean canDone(String realName, String studentNumber) {
        return !(TextUtils.isEmpty(realName) || TextUtils.isEmpty(studentNumber) || studentNumber.length() != 8);
    }

    /**
     * 注册
     *
     * @param phoneNumber      电话号码
     * @param password         密码
     * @param verificationCode 验证码
     */
    public void register(String phoneNumber, String password, Integer verificationCode) {

    }

}
